<!DOCTYPE html>
<html>
<head>
	<title></title>
	<script language="javascript">  

//创建一个showhidediv的方法，直接跟ID属性  
function showhidediv(id){  
var age=document.getElementById("msg_2");  
var name=document.getElementById("msg_1");  
if (id == 'name') {  
   if (name.style.display=='none') {  
    age.style.display='none';  
    name.style.display='block';  
   }  
} else {  
   if (age.style.display=='none') {  
    name.style.display='none';  
    age.style.display='block';  
   }  
}     
}  

	$function(){
		$('input').click(){
			
		}
	}
</script>  

</head>
<body>
<div id="show" style="float:left;" onMouseMove='showhidediv("name")';>Name：</div>
<div id="show" style="float:left;" onMouseMove='showhidediv("age")';>Age：</div>
<div><input type="button" name='showhidediv' onclick='showhidediv("name")'>显示年龄</div>  
<div><button ng-click='showhidediv("name")';>显示年龄</button></div>  
<div id="msg_1" style="display:none;float:left;">林雨林</div>  
<div id="msg_2" style="display:none;float:left;">18</div>  
</body>
</html>